<template>
	<view class="bgc-white">
		<uv-navbar auto-back placeholder />
		<view class="px-80">
			<text class="edit-password_title mt-50 block">{{ formType ? '验证码登录' : '账户密码登录' }}</text>
			<text class="block text-32 mt-30">验证您的账户并重置密码登录</text>
			
			<!-- 表单 -->
			<edit-password_form :is-password="true" ref="formRef" />
			
			<!-- 按钮 -->
			<view class="mt-100">
				<fui-button text="确认修改" @click="onConfirm" />
			</view>
		</view>
	</view>
</template>

<script setup>
	
	import { ref } from 'vue'
	
	import editPassword_form from './components/form'
	
	import { symCodeByPassword } from '@/common/apis/account'
	
	const formRef = ref(null)  // 表单实例
	
	async function onConfirm() {
		const result = await formRef.value.verifyFrom()
		await symCodeByPassword({ ...result, password: result.newPassword })
		uni.redirectTo({ url: `/pages/account/resetSuccess?mobile=${result.mobile}` })
	}
	
</script>

<style>page{background-color: #fff}</style>
<style scoped lang="scss">
	.edit-password_title{color: #3A3F5E;font-size: 48rpx}
	.block{color: #626780}
</style>